package com.controller;

import com.github.pagehelper.PageInfo;
import com.model.BlacklistModel;
import com.model.ReponseDto;
import com.model.SysOperateLog;
import com.service.impl.SysOperateLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author
 * @Description: 日志管理
 * @date 2021/4/17 17:26
 */
@RestController
@RequestMapping("/sysLog")
@Api(tags = "日志管理模块", value = "日志管理模块相关api")
public class SysOperateLogController {

    @Autowired
    private SysOperateLogService sysOperateLogService;

    @GetMapping("/list")
    @ApiOperation(value = "日志管理-列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "id", required = true),
            @ApiImplicitParam(name = "name", value = "用户名", required = true),
    })
    public ReponseDto<PageInfo<SysOperateLog>> SysOperateLogList(@RequestParam(value = "name",required = false) String name,
                                                         @RequestParam(value = "id",required = false) Long id,
                                                         @RequestParam(value = "pageNo",required = true) String pageNo,
                                                         @RequestParam(value = "pageSize",required = true) Integer pageSize){
        return new ReponseDto<>(sysOperateLogService.logList(name,id,pageNo,pageSize));
    }
}
